package ru.spbu.mm.diploma.server.dao;

import org.springframework.orm.hibernate3.support.HibernateDaoSupport;
import ru.spbu.mm.diploma.common.entity.Project;

import java.util.List;

/**
 *
 */
public class ProjectDAOImpl extends HibernateDaoSupport implements IProjectDAO {
    public Project getProjectWithId(Integer id) {
        return null;  //To change body of implemented methods use File | Settings | File Templates.
    }

    public Project getProjectWithName(String name) {
        return null;  //To change body of implemented methods use File | Settings | File Templates.
    }

    public void addProject(Project p) {
        this.getHibernateTemplate().persist(p);
    }

    public void updateProject(Project p) {
        this.getHibernateTemplate().update(p);
    }

    public Project deleteProject(Project p) {
        return null;  //To change body of implemented methods use File | Settings | File Templates.
    }

    public List<Project> getProjects() {
        return (List<Project>) this.getHibernateTemplate().loadAll(Project.class);
    }
}
